﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using DTO;
using ModuleDALCore;

namespace DAL
{
	public class KEHOACHDAO:DALBase
	{
		public KEHOACHDAO()
		{
			this.OpenConnect();
		}
		private DataTable dt;
		private string _SpName;

		public string SpName
		{
			get { return "SPKEHOACH"; }
			set { _SpName = value; }
		}
		public List<KEHOACH> GetDSPHONG()
		{
			dt = new DataTable();

			List<KEHOACH> ds = new List<KEHOACH>();
			try
			{

				dt = DBManager.Intance.ExecuteDataTable(SpName, ConvertClassToArray.GetParamName(new KEHOACH(), null), ConvertClassToArray.GetValues(new KEHOACH(), 0));
				ds = (List<KEHOACH>)ConvertDatatableToList.ConvertTo<KEHOACH>(dt);
			}
			catch { return null; }//throw new InvalidExpressionException("Msg1: Can't list NHANVIEN"); }
			return ds;
		}
	}
}
